package com.wq.sofa.framework.bolt.model;

import java.io.Serializable;
import java.util.Map;

/**
 * @Author: wangqiang20995
 * @Date:2018/9/19
 * @Description:
 * @Resource:
 */
public class CommonRequest implements Serializable {

    public static final byte COMMON_CONNECTION = 1;

    public static final byte DUBLE_COMMUNICATION_CONNECTION = 2;

    private String requestId;
    private byte code;
    private String system;
    private Map<String,DataBase> baseMap;

    @Override
    public String toString() {
        return "CommonRequest{" +
                "requestId='" + requestId + '\'' +
                ", code=" + code +
                ", system='" + system + '\'' +
                ", baseMap=" + baseMap +
                '}';
    }

    public String getRequestId() {
        return requestId;
    }

    public void setRequestId(String requestId) {
        this.requestId = requestId;
    }

    public byte getCode() {
        return code;
    }

    public void setCode(byte code) {
        this.code = code;
    }

    public String getSystem() {
        return system;
    }

    public void setSystem(String system) {
        this.system = system;
    }

    public Map<String, DataBase> getDataBaseMap() {
        return baseMap;
    }

    public void setDataBaseMap(Map<String, DataBase> baseMap) {
        this.baseMap = baseMap;
    }

    public DataBase generatorDataBase(int id,String url,String dirver){
        return new DataBase(id,url,dirver);
    }

    public class DataBase implements Serializable{
        private int id;
        private String url;
        private String driver;

        public DataBase(int id,String url,String driver){
            this.id = id;
            this.url = url;
            this.driver = driver;
        }

        @Override
        public String toString() {
            return "DataBase{" +
                    "id=" + id +
                    ", url='" + url + '\'' +
                    ", driver='" + driver + '\'' +
                    '}';
        }

        public int getId() {
            return id;
        }

        public void setId(int id) {
            this.id = id;
        }

        public String getUrl() {
            return url;
        }

        public void setUrl(String url) {
            this.url = url;
        }

        public String getDriver() {
            return driver;
        }

        public void setDriver(String driver) {
            this.driver = driver;
        }
    }
}
